<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <style>
        table {
            width: 100%;
            border-collapse: collapse;
        }

        table caption {
            font-size: 2em;
            font-weight: bold;
            margin: 1em 0;
        }

        th, td {
            border: 1px solid #999;
            text-align: center;
            padding: 5px 0;
        }

        table thead tr {
            background-color: #008c8c;
            color: #fff;
        }

        table tbody tr:nth-child(odd) {
            background-color: #eee;
        }

        table tbody tr:hover {
            background-color: #ccc;
        }

        table tbody tr td:first-child {
            color: #f40;
        }

        table tfoot tr td {
            text-align: right;
            padding-right: 20px;
        }

        * {
            margin: 0;
            padding: 0;
        }

        ul {
            margin: 0 auto;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 50px;
            list-style: none;
            box-shadow: 0 2px 4px #eeeeee;
        }

        ul > li {
            padding: 6px 16px;
            margin: 0 5px;
            border-right: 1px solid #f7f7f7;
            border-bottom: 1px solid transparent;
            cursor: pointer;
        }

        ul > li:last-child {
            border-right: none;
        }

        li:hover, li:focus, .active {
            color: #ff6615;
            border-bottom: 1px solid #ff6615;
        }

        .btn {
            width: 110px;
            height: 40px;
            color: #fff;
            background: linear-gradient(0deg, rgba(0, 172, 238, 1) 0%, rgba(2, 126, 251, 1) 100%);
            font-family: 'Lato', sans-serif;
            font-weight: 12;
            border-radius: 5px;
            box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
            7px 7px 20px 0px rgba(0, 0, 0, .1),
            4px 4px 5px 0px rgba(0, 0, 0, .1);
            transition: all 0.3s ease;
            cursor: pointer;
            border: none;
            position: relative;
            line-height: 34px;
            padding: 0;

            display: block;
            margin: 0 auto;
        }

        .btn span {
            position: relative;
            display: block;
            width: 100%;
            height: 100%;
            font-size: 18px;
        }

        .btn::before, .btn::after {
            position: absolute;
            content: '';
            top: 0;
            right: 0;
            background: rgba(2, 126, 251, 1);
            transition: all 0.3s ease;
        }

        .btn::before {
            width: 0;
            height: 2px;
        }

        .btn::after {
            height: 0;
            width: 2px;
        }

        .btn span::before,
        .btn span::after {
            position: absolute;
            content: '';
            bottom: 0;
            left: 0;
            background: rgba(2, 126, 251, 1);
            transition: all 0.3s ease;
        }

        .btn span::before {
            width: 0;
            height: 2px;
        }

        .btn span::after {
            height: 0;
            width: 2px;
        }

        .btn:hover {
            background: transparent;
            color: rgba(2, 126, 251, 1);
        }

        .btn:hover::before {
            width: 100%;
        }

        .btn:hover::after {
            height: 100%;
        }

        .btn span:hover::before {
            width: 100%;
        }

        .btn span:hover::after {
            height: 100%;
        }

        .center_text {
            display: block;
            width: 1580px;
            margin: 0 auto;
        }

        .finput {
            width: 100%;
            height: 200px;
        }

        #bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
        }

        #box {
            width: 260px;
            position: absolute;
            z-index: 2;
            left: 50%;
            margin-left: -130px;
            top: 50%;
            margin-top: -75px;
            background-color: #fff;
        }

        #box .title {
            background-color: #008081;
            color: #fff;
            padding: 10px 20px;
        }

        #box .con {
            overflow: hidden;
        }

        #box .con .img {
            margin: 10px;
            float: left;
        }

        #box .con .rright {
            float: left;
            margin-bottom: 20px;
        }

        #box .con .rright .btn {
            text-align: center;
        }

        #box .con .rright .btn > button {
            width: 80px;
            height: 30px;
            font-size: 20px;
            border: none;
            background-color: #008081;
            color: #fff;
        }


        .topbody {
            width: 900px;
            margin: 0 auto;
        }

        .topbar {
            width: 100%;
            background-color: #000;
            display: inline-block;
        }

        .topbar li {
            float: left;
        }

        .toplist {
            display: inline-block;
            list-style-type: none;
        }

        .toplist a {
            color: #FFF;
            text-decoration: none;
        }

        .title, .toplist a {
            display: block;

            display: block;
            float: left;
        }

        .toplist a {
            padding: 15px 20px 15px 20px;
        }

        .title {
            color: #FFF;
            text-decoration: none;
            padding: 15px 30px 15px 30px;
        }
    </style>
</head>
<body>

<div style="width: 100%; height: 100px">
    <div class="topbar">
        <div class="topbody">
            <span class="title">deicide系统</span>
            <ul class="toplist">
                <li><a href="/notepad">笔记本</a></li>
                <li><a href="/">每日任务记录</a></li>
            </ul>
        </div>
    </div>
</div>


<h1 style="color: red"></h1>
<button id="btnShow" class="btn">添加一条任务</button>

<div>
    <ul id="nav">
        <li><a href="?liststatus=1">查看全部任务</a></li>
        <li><a href="?liststatus=0">查看进行中的任务</a></li>
    </ul>
</div>
<!--<ul id="nav">-->
<!--    {% for item in time_list %}-->
<!--    {% if item == nowtime %}-->
<!--    <li class="active"><a href="?time={{item}}">{{ item }}</a></li>-->
<!--    {% else %}-->
<!--    <li><a href="?time={{item}}">{{ item }}</a></li>-->
<!--    {% endif %}-->
<!--    {% endfor %}-->
<!--</ul>-->
<div class="center_text">
    <table>
        <tr>
            <th>ID</th>
            <th>内容</th>
            <th>时间</th>
            <th>执行次数</th>
            <th>最新完成</th>
            <th>状态</th>
        </tr>
        {% for item in list %}
        <tr>
            {% for item1 in item[:1] %}
            <td><a href="" target="_blank">{{ item1 }}<br/></a></td>
            {% endfor %}
            {% for item2 in item[1:2] %}
            <td width="1100px">{{ item2 }}<br/></td>
            {% endfor %}
            {% for item2 in item[3:4] %}
            <td>{{ item2 }}<br/></td>
            {% endfor %}
            {% for item2 in item[4:5] %}
            <td>
                <!-- 执行次数 -->
                {{ item2 }}<br/>
                <form name="from3" method="post" action="/updatanum">
                    <input type="text" name="id" value="{{item[0]}}" hidden>
                    <input type="text" name="num" value="{{item2}}" hidden>
<!--                    <input type="submit" style="background-image:url('../static/img/dianzan.png'); border:none" value="添加一次">-->
                    <input type="image" src="../static/img/dianzan.png" width="30px" height="30px">
<!--                    <img alt="提交" src="../static/img/dianzan.png" οnclick="return dosubmit();" style="cursor:pointer;">-->
                </form>
            </td>
            {% endfor %}
            {% for item2 in item[5:6] %}
            <td>{{ item2 }}<br/></td>
            {% endfor %}
            {% for value in item[2:3] %}
            {% if value == 0 %}
            <td>
                <!--                    <button class="btn"><span>点击完成</span></button>-->
                <form name="from1" method="post" action="/updata">
                    <input type="text" name="id" value="{{item[0]}}" hidden>
                    <input type="submit" value="点击完成" class="btn">
                </form>
                <form name="from2" method="post" action="/del">
                    <input type="text" name="id" value="{{item[0]}}" hidden>
                    <input type="submit" value="删除记录" class="btn">
                </form>
            </td>
            {% elif value == 1 %}
            <td>
                已完成
                <form name="from1" method="post" action="/del">
                    <input type="text" name="id" value="{{item[0]}}" hidden>
                    <input type="submit" value="删除记录" class="btn">
                </form>
            </td>
            {% elif value == 2 %}
            <td> 已取消 <br/></td>
            {% else %}
            <td>{{ value }}<br/></td>
            {% endif %}
            {% endfor %}
        </tr>
        {% endfor %}
    </table>
</div>


<div id="bg">        <!-- 定义一个弹窗 -->
    <div id="box">
        <div class="title"> 提示</div>
        <div class="con">
            <form name="from1" method="post" action="/add">
                <label>请输入内容:</label>
                <textarea id="my-textarea" class="finput" name="content"></textarea>
                <!--                <input type="text" class="finput" name="content" style="white-space: pre-wrap;">-->
                <input type="submit" value="提交" class="btn" id="cls">
            </form>
        </div>
    </div>
</div>

<div id="event-data"></div>


<script>
    var btnShow = document.getElementById("btnShow");
    btnShow.onclick = function () {
        var bg = document.getElementById("bg");
        var box = document.getElementById("box");
        bg.style.display = 'block';
        box.style.display = 'block';
    }
    var btnCls = document.getElementById("cls");
    btnCls.onclick = function () {
        bg.style.display = 'none';
        box.style.display = 'none';
    }
</script>


</body>
</html>